﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileCabinetTree.aspx.cs" Inherits="Honestysoft.Financing.WebUI.Module.Attach.FileCabinetTree" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" href="../../Scripts/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css" />
	<script type="text/javascript" src="../../Scripts/zTree/js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="../../Scripts/zTree/js/jquery.ztree.core-3.0.js"></script>
	<script type="text/javascript" src="../../Scripts/zTree/js/jquery.ztree.excheck-3.0.js"></script>
	<script type="text/javascript" src="../../Scripts/zTree/js/jquery.ztree.exedit-3.0.js"></script>
    <script type="text/javascript">
        <!--
        var setting = {
            view: {
		        selectedMulti: false
	        },
            edit: {
                enable: true,
                showRemoveBtn: false,
                showRenameBtn: false
            },
            async: {
                enable: true,
                url: "Json/FileCabinetTree.ashx",
                autoParam: ["id"],
                otherParam: { "FunctionID":"<%=Request["FunctionID"]+"" %>" },
                dataFilter: null
            },
            callback: {
                onAsyncSuccess: zTreeOnAsyncSuccess,
                beforeClick: beforeClick,
				onClick: onClick
            }
        };
        function beforeClick(treeId, treeNode, clickFlag) {
            
		}
		function onClick(event, treeId, treeNode, clickFlag) {
            if(!treeNode.open){
                var zTree = $.fn.zTree.getZTreeObj("treeDemo");
			    zTree.expandNode(treeNode);
            }
            window.parent.frames[treeNode.target].location.href=treeNode.url;
		}
        $(document).ready(function () {
            $.fn.zTree.init($("#treeDemo"), setting); 
            var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
        });
        var isFirst=true;
        function zTreeOnAsyncSuccess(event, treeId, treeNode, msg) {
            if (isFirst) {
                var zTree = $.fn.zTree.getZTreeObj("treeDemo");
                var nodes = zTree.getNodes();
                zTree.selectNode(nodes[0]);
                isFirst=false;
                zTree.expandNode(nodes[0]);                
            }
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="zTreeDemoBackground left">
		<ul id="treeDemo" class="ztree"></ul>
	</div>
    </form>
</body>
</html>
